package com.hnust.store;

import com.hnust.controller.MainController;
import com.hnust.domain.BulkImport;
import javafx.geometry.Rectangle2D;
import javafx.stage.Screen;
import lombok.Data;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 用于存放界面的公共数据
 */
@Component
@Data
public class DataStore {
    private String token;
    private String college_id;
    private String college_name;
    private String teacher_id;//老师id
    private String teacher_name;
    private String group_id;
    private Double screenWidth;
    private Double screenHeight;
    private static final Logger logger = LogManager.getLogger(DataStore.class);
    @PostConstruct
    private void getScreen(){
        Screen s=Screen.getPrimary();
        Rectangle2D visualBound=s.getVisualBounds();
        this.setScreenHeight(visualBound.getHeight());
        this.setScreenWidth(visualBound.getWidth());
        logger.info("获取屏幕宽高...宽度："+this.getScreenWidth()+",高度："+this.getScreenHeight());
    }
    private BulkImport bulkImport;
}
